import { WebPlugin } from '@capacitor/core';
import { MonitorPluginPlugin } from './definitions';

export class MonitorPluginWeb extends WebPlugin implements MonitorPluginPlugin {
  constructor() {
    super({
      name: 'MonitorPlugin',
      platforms: ['web'],
    });
  }

  async echo(options: { value: string }): Promise<{ value: string }> {
    console.log('ECHO', options);
    return options;
  }

  async test(options: { value: string }): Promise<{ value: string }> {
    console.log('test', options);
    return options;
  }

  async doRun(options: { value: string }): Promise<{ value: string }> {
    console.log('doRun', options);
    return options;
  }

  async check(options: { value: string, address: string, lightNo: number, channel: number }): Promise<{ value: string, address: string, lightNo: number, channel: number }> {
    console.log('check', options);
    return options;
  }


  async perform(options: { type: string, value: string }): Promise<{  type: string, value: string }> {
    console.log('perform', options);
    return options;
  }
}

const MonitorPlugin = new MonitorPluginWeb();

export { MonitorPlugin };

import { registerWebPlugin } from '@capacitor/core';
registerWebPlugin(MonitorPlugin);
